-module(avl).
-export([new/0, append/3, find/2, erase/2]).

new()->
	{nil, nil, 0, nil, nil}.

find(_, {nil, nil, 0, nil, nil})->
	not_found;
find(K, {K, V, _, _, _})->
	{ok, V};
find(K, {K1, _, _, Smaller, _}) when K < K1->
	find(K, Smaller);
find(K, {K1, _, _, _, Bigger}) when K > K1->
	find(K, Bigger).

append(K, V, {nil, nil, 0, nil, nil})->
	{K, V, 1, new(), new()};
append(K, V, {K1, V2, H})->
